#include "CTransform.h"

BEGIN_WARECOMMON

void CTransform::GetMatrix4( CMatrix4& m )
{
	m.MakeIdentity();

	m.m[0][0] = m_matRotate.data[0][0];
	m.m[0][1] = m_matRotate.data[0][1];
	m.m[0][2] = m_matRotate.data[0][2];
	m.m[1][0] = m_matRotate.data[1][0];
	m.m[1][1] = m_matRotate.data[1][1];
	m.m[1][2] = m_matRotate.data[1][2];
	m.m[2][0] = m_matRotate.data[2][0];
	m.m[2][1] = m_matRotate.data[2][1];
	m.m[2][2] = m_matRotate.data[2][2];

	m  = m.MakeScale( m_Scale[0], m_Scale[1], m_Scale[2], 1.0f );  // w = 1.0f default

	m.SetTrans( m_Translate );
}

///
CTransform& CTransform::operator=( CTransform& trans )
{
	m_matRotate = trans.m_matRotate;
	m_Translate = trans.m_Translate;
	m_Scale = trans.m_Scale;

	return *this;
}

END_WARECOMMON